package com.fesine.spring.framework;

/**
 * @description: 类描述
 * @author: Fesine
 * @createTime:2016/12/4 20:15
 * @update:修改内容
 * @author: Fesine
 * @updateTime:2016/12/4 20:15
 */
public class StaticInt {
    public static void printC(String s) {
        System.out.println(s);
    }

    Value3 v = new Value3(10);
    static Value3 v1,v2;
    static {
        printC("v1.c=" + v1.c + "  v2.c=" + v2.c);
        v1 = new Value3(27);
        printC("v1.c=" + v1.c + "  v2.c=" + v2.c);
        v2 = new Value3(15);
        printC("v1.c=" + v1.c + "  v2.c=" + v2.c);

    }

    public static void main(String[] args) {
        StaticInt si = new StaticInt();
        printC("si.c="+si.v.c);
        printC("v1.c=" + v1.c + "  v2.c=" + v2.c);
        v1.inC();
        printC("v1.c=" + v1.c + "  v2.c=" + v2.c);
        printC("si.c=" + si.v.c);
    }

}

class Value3{
    static int c = 0;

    Value3() {
        c = 15;
    }

    Value3(int c) {
        this.c=c;
    }

    static void inC() {
        c++;
    }
}
